<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\SoftDeletes;
class AdminUser extends Model
{  
    use HasDateTimeFormatter,SoftDeletes;
    protected $table = 'users';
    protected $fillable = [
        'name',
        'email',
       'uid',
        'day',
        'password',
        'remember_token',
        'expired_at'
    ];
        public function getExpiredAtAttribute() {
        $expired_at=$this->attributes['expired_at'];
        if ($expired_at){
          //  return  Carbon::createFromFormat('Y-m-d',$expired_at);
             return Carbon::parse($expired_at)->toDateTimeString();

        }
        return $expired_at;
    }
    
}